// import Mock from 'mockjs'

export default [
  // user login
  {
    url: '/vueLogin',
    type: 'post',
    response: config => {
      return {
        'status': '0',
        'result': true,
        'message': '登录成功',
        'data': 'b118827e1271c72fa961a1af40b7bc6b',
        'roleName': '渠道01',
        'user': {
          'account': 'cd01',
          'admin': 0,
          'channelId': 'dabaitu',
          'createTime': 1572828234841,
          'dbConfig': 1,
          'email': '1@qq.com',
          'groupRole': '',
          'id': 1000002,
          'loginCount': 0,
          'loginInTime': 1572828234841,
          'mobile': '',
          'name': '渠道1',
          'onlineTime': 0,
          'operatorId': 1000001,
          'password': '$2a$10$n30w7A56Q0HIeFBUpGkUcuoJdqMdNrgM9GgvtG8BILfYFbtvrT.7W',
          'qq': '',
          'remark': '',
          'status': 1,
          'updateTime': 1572828234841,
          'userGroup': 1000002
        }
      }
    }
  },

  // get user info
  {
    url: '/getUserInfo',
    type: 'get',
    response: config => {
      const { token } = config.query
      console.log(`传递参数token：${token}`)
      // 组装详情数据
      const data = {
        agent: {},
        authMenu: [],
        user: {
          id: 1000115,
          userId: 1000115,
          name: '测试001',
          accountName: 'cs001',
          menuList: [],
          // deleteStatus: 0,
          // deptId: 1,
          // locked: 0,
          // createTime: '2019-06-18 09:10:34',
          // isAgent: 0,
          // role: {
          //   id: 2,
          //   name: '渠道',
          //   code: 'channel'
          // },
          role: '渠道',
          dept: {}
        }
      }
      return {
        'status': '0',
        'result': true,
        'message': '查询成功',
        'data': data
      }
    }
  },

  // user logout
  {
    url: '/vueLoginOut',
    type: 'get',
    response: _ => {
      return {
        'status': '0',
        'result': true,
        'message': '退出成功',
        'data': null
      }
    }
  }
]
